<?php
namespace app\model;
use think\Model;
use mailer\tp51\Mailer;
class Mail extends Model{

  public function code($to_email,$code){
    $mailer = Mailer::instance();
    $result = $mailer->to($to_email)
    ->subject('短信验证码')
    ->text(sprintf("【豌豆电商】验证码%s，请妥善保管账户信息。",$code))
    ->send();
    return $result;
  }
}
 ?>
